/*
 * Copyright 2004-2005 asoft
 * 本软件及其所有拷贝的名称，与光盘上或本软件中注明的公司同在。
 * 本软件及文档享有版权，并受国家版权法及国际协约条款的保护。
 * 您不可以从本软件中去掉其版权声明；并保证为本软件的拷贝（本部或部分）* 复制版权声明。
 * 您同意制止以任何形式非法拷贝本软件及文档。
 * 版权信息参见：
 *      http://www.asoft.cn/licenses
 */

package com.asoft.common.logs.model;

import java.io.Serializable;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;

import com.asoft.common.base.model.BaseObject;

/**
 * <p>Title: 操作日志</p>
 * <p>Description: TransferObject </p>
 * <p>Copyright: Copyright (c) 2003</p>
 * <p>Company: asoft</p>
 * @ $Author: author $
 * @ $Date: 2004/12/17 13:54:17 $
 * @ $Revision: 1.4 $
 * @ created in 2005-11-14
 *
 */

public class OperatingLog extends BaseObject
                          implements Serializable
{
        private String id;

        private String moduleId; // 模块id

        private String module;

        private String modelId;

        private String model;

        private String serviceId;

        private String service;

        private String result; //  操作结果

        private String detail; // 细节

        private String operatorId;

        private String operatorName;

        private Timestamp operatingTime; // 操作时间

        /**
         * 构造函数
         */
        public OperatingLog()
        {
                // for hibernate
        }

        /** 选用框架提供的pri解决方案，必须 */
        public Serializable getIdentity()
        {
                return this.id;
        }

        public OperatingLog(String id)
        {
                this.id = id;
        }

        public String getId()
        {
                return this.id;
        }

        public void setId(String id)
        {
                this.id = id;
        }

        public String getModuleId()
        {
               return this.moduleId;
        }

        public void setModuleId(String moduleId)
        {
               this.moduleId = moduleId;
        }

        public String getModule()
        {
               return this.module;
        }

        public void setModule(String module)
        {
               this.module = module;
        }

        public String getModelId()
        {
                return this.modelId;
        }

        public void setModelId(String modelId)
        {
                this.modelId = modelId;
        }

        public String getModel()
        {
                return this.model;
        }

        public void setModel(String model)
        {
                this.model = model ;
        }

        public String getServiceId()
        {
                return this.serviceId;
        }

        public void setServiceId(String serviceId)
        {
                this.serviceId = serviceId;
        }

        public String getService()
        {
                return this.service;
        }

        public void setService(String service)
        {
                this.service = service;
        }

        public String getResult()
        {
                return this.result;
        }

        public void setResult(String result)
        {
                this.result = result;
        }

        public String getDetail()
        {
                return this.detail;
        }

        public void setDetail(String detail)
        {
                this.detail = detail;
        }

        public String getOperatorId()
        {
                return this.operatorId;
        }

        public void setOperatorId(String operatorId)
        {
                this.operatorId = operatorId;
        }

        public String getOperatorName()
        {
                return this.operatorName;
        }

        public void setOperatorName(String operatorName)
        {
                this.operatorName = operatorName;
        }

        public Timestamp getOperatingTime()
        {
                return this.operatingTime;
        }

        public void setOperatingTime(Timestamp operatingTime)
        {
                this.operatingTime = operatingTime;
        }

        public String getFormatedOperatingTime(String p)
        {
                SimpleDateFormat sform = new SimpleDateFormat(p);
                return sform.format(this.operatingTime);
        }

        public String toString()
        {
                StringBuffer sb = new StringBuffer(100);
                sb.append(this.getClass());
                sb.append(" < ");
                sb.append("id: ");
                sb.append(this.id);
                sb.append(", moduleId: ");
                sb.append(this.moduleId);
                sb.append(", modelId: ");
                sb.append(this.modelId);
                sb.append(", pri: ");
                sb.append(this.getPri());
                sb.append(" > ");
                return sb.toString();
        }
}
